<?php
    define('KYOMINI_GO',true);	
    require_once('admin_conn.php');
	require_once ('../Config/conn.php"');
    session_start();
	
	
	
	$id=$_GET['id'];
    $session = isset($_SESSION['host'])?$_SESSION['host']:'';

    if($HOST != $session){

          echo '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:(</h1><p>警告：禁止跨站非法删除！';

            echo '<script>setTimeout(\'location="login.php"\', 2000);</script>';
			exit;
	
       

	  }else{

       $ifid=$db->select("article","id",array("id" => $id));
       $noid = isset($ifid[0])?$ifid[0]:'';


	       if($id == "" || $id != $noid){
		   echo '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:(</h1><p>删除失败！没有此数据库';
	       echo '<script>setTimeout(\'location="Article_list.php"\', 1000);</script>';		
		  }else{
    	   
		   $db->delete("article",array("id" => $id));
		
		   echo '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>删除成功！';
	       echo '<script>setTimeout(\'location="Article_list.php"\', 50);</script>';
	  }
	}
?>